package edu.example.manage.view;

import edu.example.manage.utils.JDBCUtils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/view/room/manage/list")
public class RoomAdminView extends HttpServlet {
    private static final JDBCUtils jdbcUtils = JDBCUtils.createConnection();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Integer pageTotal = jdbcUtils.queryPageTotal("select count(1) as pagetotal from user");
            req.setAttribute("pageTotal", pageTotal);
        } catch (Exception e) {
            e.printStackTrace();
        }
        req.getRequestDispatcher("/manage/roomManageList.jsp").forward(req, resp);
    }
}
